package com.booking.springrestful.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 咨询室表
 * @TableName consultationroom
 */
@TableName(value ="consultationroom")
@Data
public class Consultationroom implements Serializable {
    /**
     * 咨询室id
     */
    @TableId(type = IdType.AUTO)
    private Integer consultationRoomId;

    /**
     * 咨询室名称
     */
    private String room;

    /**
     * 容纳人数
     */
    private Integer capacity;

    /**
     * 地点
     */
    private String location;

    /**
     * 已安排的时间段个数
     */
    private Integer timetotal;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Consultationroom other = (Consultationroom) that;
        return (this.getConsultationRoomId() == null ? other.getConsultationRoomId() == null : this.getConsultationRoomId().equals(other.getConsultationRoomId()))
            && (this.getRoom() == null ? other.getRoom() == null : this.getRoom().equals(other.getRoom()))
            && (this.getCapacity() == null ? other.getCapacity() == null : this.getCapacity().equals(other.getCapacity()))
            && (this.getLocation() == null ? other.getLocation() == null : this.getLocation().equals(other.getLocation()))
            && (this.getTimetotal() == null ? other.getTimetotal() == null : this.getTimetotal().equals(other.getTimetotal()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getConsultationRoomId() == null) ? 0 : getConsultationRoomId().hashCode());
        result = prime * result + ((getRoom() == null) ? 0 : getRoom().hashCode());
        result = prime * result + ((getCapacity() == null) ? 0 : getCapacity().hashCode());
        result = prime * result + ((getLocation() == null) ? 0 : getLocation().hashCode());
        result = prime * result + ((getTimetotal() == null) ? 0 : getTimetotal().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", consultationRoomId=").append(consultationRoomId);
        sb.append(", room=").append(room);
        sb.append(", capacity=").append(capacity);
        sb.append(", location=").append(location);
        sb.append(", timetotal=").append(timetotal);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}